﻿using System;

namespace NanoMvvm
{
    public interface IMediator
    {
        bool RegisterHandler<TMessage>(Action<TMessage> handler);

        bool RegisterHandler<TMessage>(object key, Action<TMessage> handler);

        bool UnregisterHandler<TMessage>(Action<TMessage> handler);

        bool UnregisterHandler<TMessage>(object key, Action<TMessage> handler);

        int NotifySubscribers<TMessage>(TMessage message);

        int NotifySubscribers<TMessage>(object key, TMessage message);

        void Clear();
    }
}